












































































































































































<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href="../../build/common/base.css" rel="stylesheet">

  <link rel="stylesheet" href="../../build/form/form.css">
  <link rel="stylesheet" href="../../build/form/page.css">
  <link rel="stylesheet" href="../../assets/js/common/element/index.css">
  <script type="text/javascript" src="../../build/common/base.js"></script>
  <script type="text/javascript" src="../../build/common/vueEdit.js"></script>
  <script src="../../assets/js/common/element/index.js"></script>
  <style>
    * {
      padding: 0px;
      margin: 0px;
    }

    ul li {
      list-style: none;
    }

    .my_table_box {
      display: flex;
      padding: 10px;
    }

    .link {
      height: 100%;
      width: 8px;
      background-color: #ccc;
    }

    .seek_box {
      padding: 20px;
    }

    .my_table thead th {
      white-space: nowrap;
    }

    .no_data {
      width: 100%;
      padding: 8px;
      background-color: #f9f9f9;
      text-align: center;
    }

    .no_txt {
      width: 50%;
      margin: 0 auto;
    }
  </style>
</head>

<body>
  <div id="ctrls" style="padding: 0 30px;">
    <div>
      <span @click="handSub()" class="btn btn-success fa fa-send mb30 mt30">保存</span>
      <span @click="handclos()" class="btn btn-success fa fa-send mb30 mt30">取消</span>
    </div>
    <table style="width: 100%;" class="table table-bordered table_hover text-center mb60">
      <tbody>
        <caption style="text-align: center;">编辑</caption>
       
        <tr>
          <th>任务编号</th>
          <td><input class="form-control" v-model="surbeyObj.taskNumber" type="text" name="" id="">
          </td>
        </tr>
        <tr>
          <th>任务名称</th>
          <td><input class="form-control" v-model="surbeyObj.taskName" type="text" name="" id="">
          </td>
        </tr>
        <tr>
          <th>一级目录</th>
          <td><input class="form-control" v-model="surbeyObj.first" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>二级目录</th>
          <td><input class="form-control" v-model="surbeyObj.Second" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>三级目录</th>
          <td><input class="form-control" v-model="surbeyObj.Third" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>备注</th>
          <td><input class="form-control" v-model="surbeyObj.bz" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>数量</th>
          <td><input class="form-control" v-model="surbeyObj.number" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>单位</th>
          <td><input class="form-control" v-model="surbeyObj.dw" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>人工工时(小时)</th>
          <td><input class="form-control" v-model="surbeyObj.hours" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>人工费</th>
          <td><input class="form-control" v-model="surbeyObj.Cost" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>材料</th>
          <td><input class="form-control" v-model="surbeyObj.cl" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>分包</th>
          <td><input class="form-control" v-model="surbeyObj.fb" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>机具</th>
          <td><input class="form-control" v-model="surbeyObj.tool" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>其他</th>
          <td><input class="form-control" v-model="surbeyObj.qt" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>合计(元)</th>
          <td><input class="form-control" v-model="surbeyObj.hj" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>合同额</th>
          <td><input class="form-control" v-model="surbeyObj.hte" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>税额</th>
          <td><input class="form-control" v-model="surbeyObj.se" type="text" name="" id=""></td>
        </tr>
        <tr>
          <th>含税合计</th>
          <td><input class="form-control" v-model="surbeyObj.hshj" type="text" name="" id=""></td>
        </tr>
       
        <tr>
          <th>子项目</th>
          <td><input class="form-control" v-model="surbeyObj.zxm" type="text" name="" id=""></td>
        </tr>


      </tbody>
    </table>

  </div>
</body>
<script type="text/javascript">
  var vm = new Vue({
    el: "#ctrls",
    data: function () {
      return {
        surbeyObj: {},
        ifTxt: false,
        rwid: false,
        noTex: ""
      }
    },
    beforeCreate: function () {
    },
    mounted: function () {
      // var ztreeCreator = new ZtreeCreator('orgTree', __ctx + "/org/group/getTreeData")
      //   .setCallback({ onClick: zTreeOnLeftClick, onRightClick: zTreeOnRightClick })
      //   .initZtree({}, function (treeObj) { orgTree = treeObj });

    },
    created: function () {
      this.rwid = location.search.replace("?", "")
      var that = this
      var url = "http://127.0.0.1:18084/project/selectOne/" + this.rwid
      var post = Vue.baseService.get(url);
      post.then(function (res) {
        console.log(res, "审核")
        that.surbeyObj = res
      }, function (status) {
        if (status == !0) {
          $.Toast.error('加载失败！' + status);
        }
      })
    },
    methods: {
      handclos: function () {
        console.log("dasda")
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.location.reload();//刷新父页面，注意一定要在关闭当前iframe层之前执行刷新
        parent.layer.close(index);
      },
      handSub: function () {
        var that = this
        var url = "http://127.0.0.1:18084/project/insertOne/" + this.rwid;
        // var post = Vue.baseService.postForm(url, {
        //   project: that.surbeyObj
        // });
        // $.getResultData(post, function (data) {
        //   console.log("成功了吗吗......", data)
        // });
        $.ajax({
          url: url,
          type: "post",
          // dataType: "json",
          traditional: true,
          async: false,
          data: { project: JSON.stringify(this.surbeyObj) },
          success: function (res) {
            console.log("成功了吗????????", res)
            $.Toast.success("添加成功")
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.location.reload();//刷新父页面，注意一定要在关闭当前iframe层之前执行刷新
            parent.layer.close(index);
          }
        })
      }

    },

    watch: {

    }
  });
</script>

</html>